package com.monkeyboy.mytest;

import sun.net.spi.nameservice.dns.DNSNameService;

/**
 * @Author Gavin
 * @date 2021.03.06 16:37
 */
public class TestClassLoader {
    public static void main(String[] args) {
        //bootstrap根加载器,会输出null
        System.out.println(Object.class.getClassLoader());
        System.out.println("---------------");
        //ExtClassLoader加载器，加载ext下面的类
        System.out.println(DNSNameService.class.getClassLoader());
        System.out.println("------------");
        //AppClassLoader：系统加载器加载我们自己的class文件
        System.out.println(TestClassLoader.class.getClassLoader());
    }
}
